<%@ page contentType="text/html;charset=UTF-8"%>
<jsp:directive.include file="/WEB-INF/view/jsp/admin/includes/top.jsp" />
<h3>
	积分规则列表
</h3>
<!-- start user list -->
<ec:table items="page.result" var="creditRule" rowsDisplayed="10"
	autoIncludeParameters="true" retrieveRowsCallback="limit"
	action="${ctx}/admin/creditRule!list.do">
	<ec:row highlightRow="true">
		<ec:column property="rowcount" cell="rowCount" sortable="false"
			title="序号" width="30" />

		<ec:column property="name" title="积分规则名称" />
		<ec:column property="action" title="积分动作" />
		<ec:column property="null" title="周期类型" width="60" sortable="true">
						${creditRule.cycleType.comment }
					</ec:column>
		<ec:column property="rewardNum" title="奖励次数" width="30"
			sortable="true" />
		<c:forEach items="${creditTypeList}" var="creditType">
			<ec:column property="null" title="${creditType.title}" width="60"
				sortable="false">
				<c:forEach items="${creditRule.creditRuleAmounts}"
					var="creditRuleAmount">
					<c:if
						test="${creditRuleAmount.creditType.title == creditType.title}">
									${creditRuleAmount.amout}
								</c:if>
				</c:forEach>
			</ec:column>
		</c:forEach>
		<ec:column property="null" title="动作" sortable="false" width="30"
			viewsAllowed="html">
			<security:authorize ifAnyGranted="ROLE_ADMIN">
				<a href="#" class="ref"
					onclick="javascript:go('${ctx}/admin/creditRule!edit.do?id=${creditRule.id}');">修改</a>
			</security:authorize>
		</ec:column>

	</ec:row>
</ec:table>
<!-- end user list -->
<div id="footer" class="footer">
	<security:authorize ifAnyGranted="ROLE_ADMIN">
		<input type="button" class="button"
			onclick="javascript:go('${ctx}/admin/creditRule!input.do');"
			value='增加新积分规则' />
	</security:authorize>
</div>
<jsp:directive.include
	file="/WEB-INF/view/jsp/admin/includes/bottom.jsp" />